<template>
    <aside class="asideStyle">
        <el-row :gutter="10">
            <el-col :span="2.5">
                <el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="addBtn" :disabled=" $store.state.system_type==0 ? false : true ">新增</el-button>
                <add-dialog ref="addCom" @reloadFun="reloadFun" />
            </el-col>
            <el-col :span="2.5">
                <el-button type="primary" size="mini" icon="el-icon-search" @click="searchBtn" >查找</el-button>
                <search-box @searchFun="searchFun" ref="search"/>
            </el-col>
        </el-row>
    </aside>
</template>

<script>
    import addDialog from './add-product.vue'
    import searchBox from './search-component.vue'
    export default {
        name: "product-add",
        components: {
            addDialog,
            searchBox
        },
        data() {
          return {

          }
        },
        methods: {
            addBtn() {
                this.$refs['addCom'].dialogFormVisible = true
            },
            reloadFun() {
                this.$emit('reloadFun')
            },
            searchBtn() {
                this.$refs['search'].dialogFormVisible = true
            },
            searchFun(val) {
                this.$emit('searchFun', val)
            }
        }
    }
</script>

<style scoped>
    .el-button {
        width: 100%;
    }
</style>
